from flask import request,g
from common.utlis.jwt_util import check_token,_generate_token


def jwt_authentication():
    token = request.headers.get('Authorization')
    if token:
        payload = check_token(token)
        print('payload>>', payload)

        if payload:
            g.user_id = payload.get('id')